package com.workerhelping.feignClients;

import com.workerhelping.dto.*;
import com.workerhelping.po.*;
import com.workerhelping.result.Result;
import com.workerhelping.vo.AnalyzeRecordMoneyVO;
import com.workerhelping.vo.AnalyzeYearAndMoneyVO;
import com.workerhelping.vo.IncomeVO;
import com.workerhelping.vo.SubmitNoticeVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient("MYSQL")
public interface MySQLFeignClient {
    /**
     * 登录
     *
     * @param admin
     * @return
     */
    @PostMapping("/admin/login")
    Result<Object> adminLogin(@RequestBody Admin admin);


    /**
     * 根据档案id获取档案
     *
     * @param recordIdDTO
     * @return
     */
    @PostMapping("/adminRecord/getRecordByRecordId")
    Result<Record> getRecordByRecordId(@RequestBody RecordIdDTO recordIdDTO);


    /**
     * 根据档案id查询致困原因
     *
     * @param recordIdDTO
     * @return
     */
    @PostMapping("/adminRecord/getAllStuckReasonByRecordId")
    Result<List<StuckReason>> getAllStuckReasonByRecordId(@RequestBody RecordIdDTO recordIdDTO);


    /**
     * 修改档案状态
     *
     * @param workerStatusInfoDTO
     * @return
     */
    @PostMapping("/worker/updateWorkerStatusInfo")
    Result<String> updateWorkerStatusInfo(@RequestBody WorkerStatusInfoDTO workerStatusInfoDTO);

    /**
     * 保存消息信息
     *
     * @param confirm
     * @return
     */
    @PostMapping("/adminRecord/saveConfirm")
    Result<String> saveConfirm(@RequestBody Confirm confirm);


    /**
     * 更新员工信息，用于删除档案
     *
     * @param workerInfoDTO
     * @return
     */
    @PostMapping("/worker/updateWorkerInfo")
    Result<String> updateWorkerInfo(@RequestBody WorkerInfoDTO workerInfoDTO);


    /**
     * 删除档案信息
     *
     * @param recordIdDTO
     * @return
     */
    @PostMapping("/record/deleteRecordById")
    Result<String> deleteRecordById(@RequestBody RecordIdDTO recordIdDTO);


    /**
     * 删除关联的致困原因
     *
     * @param recordIdDTO
     * @return
     */
    @PostMapping("/record/deleteRecordStuckReasonByRecordId")
    Result<String> deleteRecordStuckReasonByRecordId(@RequestBody RecordIdDTO recordIdDTO);

    /**
     * 查询档案
     *
     * @return
     */
    @GetMapping(value = "/notice/search")
    Result<List<Notice>> search();

    /**
     * 根据关键词查询
     *
     * @param keyword
     * @return
     */
    @PostMapping(value = "/notice/search/{keyword}")
    Result<List<Notice>> searchByKeyword(@PathVariable("keyword") String keyword);

    /**
     * 添加政策信息
     *
     * @param noticeVO
     * @return
     */
    @PostMapping("/notice/add")
    Result<String> add(@RequestBody SubmitNoticeVO noticeVO);

    /**
     * 根据id获取档案
     *
     * @param id
     * @return
     */
    @GetMapping("/notice/getNoticeById/{id}")
    Result<Notice> getNoticeById(@PathVariable("id") Integer id);

    /**
     * 根据id删除政策信息
     *
     * @param id
     * @return
     */
    @PostMapping("/notice/deleteNoticeById/{id}")
    Result<String> deleteNoticeById(@PathVariable("id") Integer id);

    /**
     * 获取所有收入类别
     *
     * @return
     */
    @GetMapping("/getIncomeCategory")
    Result<List<IncomeCategory>> getIncomeCategory();

    /**
     * 保存收入信息
     *
     * @param incomeVO
     * @return
     */
    @PostMapping("/income/save")
    Result<Integer> saveAndIncrease(@RequestBody IncomeVO incomeVO);

    /**
     * 分页查询
     *
     * @param pageNo
     * @param pageSize
     * @return
     */
    @GetMapping("/income/findAll")
    Result<Object> getAllIncome(@RequestParam(value = "pageNo", required = false, defaultValue = "1") Integer pageNo,
                                @RequestParam(value = "pageSize", required = false, defaultValue = "6") Integer pageSize);


    @GetMapping("/adminRecord/getAllByUnreviewed")
    Result<Object> getAllByUnreviewed(@RequestParam(value = "pageNo", required = false, defaultValue = "1") Integer pageNo,
                                      @RequestParam(value = "pageSize", required = false, defaultValue = "6") Integer pageSize);

    @GetMapping("/adminRecord/getAllByApproved")
    Result<Object> getAllByApproved(@RequestParam(value = "pageNo", required = false, defaultValue = "1") Integer pageNo,
                                    @RequestParam(value = "pageSize", required = false, defaultValue = "6") Integer pageSize);

    @GetMapping("/adminRecord/getAllByRejected")
    Result<Object> getAllByRejected(@RequestParam(value = "pageNo", required = false, defaultValue = "1") Integer pageNo,
                                    @RequestParam(value = "pageSize", required = false, defaultValue = "6") Integer pageSize);

    @GetMapping("/adminRecord/getAllByCancelled")
    Result<Object> getAllByCancelled(@RequestParam(value = "pageNo", required = false, defaultValue = "1") Integer pageNo,
                                     @RequestParam(value = "pageSize", required = false, defaultValue = "6") Integer pageSize);

    @PostMapping("/incomeCategory/{id}")
    Result<IncomeCategory> getCategoryById(@PathVariable("id") Integer id);

    @PostMapping("/income/descIncome")
    Result<String> descIncome(@RequestBody AssistDTO assistDTO);

    @PostMapping("/assist/insertAssistInfo")
    Result<String> insertAssistInfo(@RequestBody AssistInfoDTO assistInfoDTO);

    @GetMapping("/analyze/getYearAndMoney")
    Result<List<AnalyzeYearAndMoneyVO>> getYearAndMoney();

    @GetMapping("/analyze/getRecordMoney")
    Result<List<AnalyzeRecordMoneyVO>> getRecordAndMoney();


}
